//
//  CZStatusButtomView.swift
//  swiftweibo
//
//  Created by Apple on 15/11/29.
//  Copyright © 2015年 tzw. All rights reserved.
//

import UIKit

class CZStatusButtomView: UIView {
    
    // MARK: - 构造函数
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        // 准备UI
        prepareUI()
    }

    private func prepareUI(){
        backgroundColor = UIColor.brownColor()
        // 添加子控件
        addSubview(forwardButtom)
        addSubview(commentButtom)
        addSubview(likeButtom)
        addSubview(sparatImageFirst)
        addSubview(sparatImageSecond)
        // 添加约束 
        // 平辅子控件
        self.ff_HorizontalTile([forwardButtom,commentButtom,likeButtom], insets: UIEdgeInsetsZero)
        sparatImageFirst.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButtom, size: nil)
        sparatImageSecond.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButtom, size: nil)
        
        
        
    }

    // MARK: - 懒加载
    // 转发
    private lazy var forwardButtom: UIButton = {
        let button = UIButton(imageName: "timeline_icon_retweet", title: "转发", color: UIColor.lightGrayColor(), sizeFont: 12)
//        // 设置图片
//        button.setImage(UIImage(named: "timeline_icon_retweet"), forState: UIControlState.Normal)
//        button.setTitle("转发", forState: UIControlState.Normal)
//        // 设置文字的颜色
//        button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
//        // 设置文字的大小 
//        button.titleLabel?.font = UIFont.systemFontOfSize(12)
        return button
    }()
    // 评论
    private lazy var commentButtom: UIButton = {
        let button = UIButton(imageName: "timeline_icon_comment", title: "评论", color: UIColor.lightGrayColor(), sizeFont: 12)
//        // 设置图片
//        button.setImage(UIImage(named: "timeline_icon_comment"), forState: UIControlState.Normal)
//        // 设置文字 
//        button.setTitle("评论", forState: UIControlState.Normal)
//        // 设置文字的颜色
//        button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
//        // 设置文字的大小
//        button.titleLabel?.font = UIFont.systemFontOfSize(12)
        
        return button
        }()
    
    // 点赞
    private lazy var likeButtom: UIButton = {
        let button = UIButton(imageName: "timeline_icon_like", title: "赞", color: UIColor.lightGrayColor(), sizeFont: 12)
//        // 设置图片
//        button.setImage(UIImage(named: "timeline_icon_like"), forState: UIControlState.Normal)
//        button.setTitle("赞", forState: UIControlState.Normal)
//        // 设置文字的颜色
//        button.setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
//        // 设置文字的大小
//        button.titleLabel?.font = UIFont.systemFontOfSize(12)
        return button
        }()
    // 添加分割线
    private lazy var sparatImageFirst: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    private lazy var sparatImageSecond: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))

}
